package com.lzx.iteam.adapter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;

import java.util.List;

/**
 * Created by zhangshuai on 15-3-13.
 */
public class FunctionCodeAdapter extends PagerAdapter {

    private List<View> mList;
    private Context mContext;
    public FunctionCodeAdapter(List<View> list, Context context){
        this.mList = list;
        this.mContext =context;
    }
    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object o) {
        return view == o;
    }

    @Override
    public Object instantiateItem(View container, int position) {
        // TODO Auto-generated method stub
        ((ViewPager) container).addView(mList.get(position));
        return mList.get(position);
    }

    @Override
    public void destroyItem(View container, int position, Object object) {
        // TODO Auto-generated method stub
        ((ViewPager) container).removeView(mList.get(position));
    }

}
